// ManagedWifi.h
#pragma once
#include"IManagedWifiContext.h"
#include "Interface.h"
#include "Network.h"

using namespace System;
using namespace System::Collections::Generic;
namespace ManagedWifi {
	public ref class NDISManagedWifiContext : IManagedWifiContext{
		public:
		
		

		NDISManagedWifiContext();
		
		~NDISManagedWifiContext();
		
		virtual property IEnumerable<IInterface^> ^ Interfaces {
			IEnumerable<IInterface^> ^ get();
		};
		
		virtual IEnumerable<INetwork ^> ^ GetAvailableNetworks(IInterface ^ wlan_interface);	
		
		virtual void Scan(IInterface ^ wlan_interface);
	private:
		enum class OS{
				WindowsXP=1, 
				WindowsVista=2
		};

		bool NDISManagedWifiContext::QueryGlobalStats(HANDLE deviceHandle, DWORD oidCode, void * buffer, int bufferSize, LPDWORD bytesRead);
		OS _os;
		String ^ _devicePrefix;
		UInt32 IoctlNdisQueryGlobalStats;
		Guid FromGUID( _GUID& guid );
		_GUID ToGUID( Guid& guid );
	};
}